<?php //echo $this->element("admin_header"); ?>

<div class="actions">
	<ul>
		<li><?php echo $html->link(__('New Image', true), array('controller'=> 'images', 'action'=>'add')); ?> </li>
	</ul>
</div>


<div class="images index">
<h2><?php __('Images');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
	<th><?php //echo $paginator->sort('post_id');?>Imageset</th>
	<th><?php echo $paginator->sort('title');?></th>
	<th><?php echo $paginator->sort('order');?></th>
	<th><?php echo $paginator->sort('filename');?></th>
	<th><?php echo $paginator->sort('created');?></th>
	<th><?php echo $paginator->sort('modified');?></th>
	<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($images as $image):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php //echo $html->link($image['Post']['title'], array('controller'=> 'posts', 'action'=>'view', $image['Post']['id'])); ?>Group?
		</td>
		<td>
			<?php echo $image['Image']['title']; ?><br />
			<p>
			[image:<?php echo $image['Image']['id']; ?> size:full]</p>
		</td>
		<td>
			<?php echo $image['Image']['order']; ?>
		</td>
		<td>
			<?php if(!empty($image['Image']['filename'])) {
				echo $lightbox->img(null, $image['Image']['dir'] . DS . $image['Image']['filename'], array('title' => $image['Image']['title']), array(), 'thumb');
			} ?>
		</td>
		<td>
			<?php echo $image['Image']['created']; ?>
		</td>
		<td>
			<?php echo $image['Image']['modified']; ?>
		</td>
		<td class="actions">
			<?php echo $html->link(__('View', true), array('action'=>'view', $image['Image']['id'])); ?>
			<?php echo $html->link(__('Edit', true), array('action'=>'edit', $image['Image']['id'])); ?>
			<?php echo $html->link(__('Delete', true), array('action'=>'delete', $image['Image']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $image['Image']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
</div>
<?php echo $this->element("paging"); ?>

